home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / keyboard.swg / 0069_Ctrl-Break Disabler.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-01-27  |  1.3 KB  |  57 lines

  1. {
  2. -> I'm having alot of trouble trying to stop people breaking out of my
  3. -> programs.  I've been trying to figure out how to stop the
  4. -> <ctrl>-<break>, <ctrl>-<c> , but with no luck...  Can't seem to find
  5. -> anything in the help menu's....
  6. -> ---
  7.  
  8. If you are using CRT, use CHECKBREAK:=FALSE.  Also, you can disble it
  9. permenantly like this:
  10. }
  11. Program TTXBREAK_Which_Means_TobinTech_ControlBreak_Disabler_Program;
  12.  
  13.  
  14. Uses DOS,CRT;
  15.  
  16. {$M 2000,0,0}
  17. {$R-,S-,I-,F+,V-,B-}
  18.  
  19. Const ControlCInt=$23;
  20.       ControlBreakInt=$1B;
  21.  
  22.  
  23. Var
  24.  OldControlCVec:Pointer;
  25.  OldControlBreakVec:Pointer;
  26.  
  27. Procedure STI;
  28. Inline($FB);
  29.  
  30. Procedure CLI;
  31. Inline($FA);
  32.  
  33. Procedure CallOldInt(Sub:Pointer);
  34. begin
  35.  Inline($9C/                    { PUSHF }
  36.         $FF/$5E/$06);
  37. end;
  38.  
  39. Procedure BlockInterrupt; Interrupt;
  40.  {BlockInterrupt is a generic procedure for blocking an interrupt}
  41. begin
  42.  STI;
  43. end;
  44.  
  45.  
  46. begin
  47.  Writeln('TobinTech Control-C disable program            ');
  48.  GetIntVec(ControlCInt, OldControlCVec);
  49.  SetIntVec(ControlCInt, @BlockInterrupt);
  50.  Writeln(' > CONTROL-C disabled.                         ');
  51.  GetIntVec(ControlBreakInt, OldControlBreakVec);
  52.  SetIntVec(ControlBreakInt, @BlockInterrupt);
  53.  Writeln(' > CONTROL-BREAK disabled.                     ');
  54.  Writeln(' Terminating, but Staying Resident in memory...');
  55.  Keep(0);
  56. End.
  57.